﻿using Microsoft.AspNetCore.Mvc;
using SqlSugar;
using SugarTest.Entity;
using Vin.Tool.Domain.ExceptionModel;

namespace SugarTest.Controllers;

public class TestController : ControllerBase
{
    // private ISqlSugarClient _sqlSugarClient;
    //
    // public TestController(ISqlSugarClient sqlSugarClient)
    // {
    //     _sqlSugarClient = sqlSugarClient;
    // }

    private Random _random = new Random();

    [HttpGet("/test")]
    public async Task<IActionResult> Test()
    {
        // if (_random.Next(0, 100) > 95)
        // {
            throw new BusinessException("测试异常");
        // }
        // await _sqlSugarClient.Queryable<Test>().ToListAsync();
        return Ok();
    }
}